<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0 ,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>结算页面</title>

		<link href="${ctxPath}/static/mall/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css" />

		<link href="${ctxPath}/static/mall/basic/css/demo.css" rel="stylesheet" type="text/css" />
		<link href="${ctxPath}/static/mall/css/cartstyle.css" rel="stylesheet" type="text/css" />

		<link href="${ctxPath}/static/mall/css/jsstyle.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${ctxPath!}/static/layer/layer.min.js"></script>
		<script type="text/javascript" src="${ctxPath}/static/mall/js/address.js"></script>

	</head>

	<body>

		@layout("/mall/layout/mallTop.html"){}
		

			<div class="clear"></div>
			<div class="concent">
				<!--地址 -->
				<form method="post" id="order_form" name="order_form" action="${ctxPath!}/person/submitOrder">
		<div class="paycont">
			<div class="address">
				<h3>确认收货地址</h3>
				<div class="control">
					<div class="tc-btn createAddr theme-login am-btn am-btn-danger">使用新地址</div>
				</div>
				<div class="clear"></div>
				
				<ul>
					@for(address in addressList!){
						 @if(address.isDefault == '0'){
						<li class="user-addresslist"><span onclick="setDefault(${address.id!})"
							class="new-option-r"> <i class="am-icon-check-circle"></i>设为默认
						</span>
							<p class="new-tit new-p-re">
								<span class="new-txt">${address.trueName!}</span> <span
									class="new-txt-rd2">${address.telPhone!}</span>
							</p>
							<div class="new-mu_l2a new-p-re">
								<p class="new-mu_l2cw">
									<span class="title">地址：</span> <span class="province">${address.areaInfo!}</span>
									<span class="street">${address.address!}</span>
								</p>
							</div>
							<div class="new-addr-btn">
								<a href="#"><i class="am-icon-edit"></i>编辑</a> <span
									class="new-addr-bar">|</span> <a href="javascript:void(0);"
									onclick="delClick(this);"><i class="am-icon-trash"></i>删除</a>
							</div></li> 
							@}else{

						<li class="user-addresslist defaultAddr"><span
							class="new-option-r"> <i class="am-icon-check-circle"></i>默认地址
						</span>
							<p class="new-tit new-p-re">
								<span class="new-txt">${address.trueName!}</span> <span
									class="new-txt-rd2">${address.telPhone!}</span>
							</p>
							<div class="new-mu_l2a new-p-re">
								<p class="new-mu_l2cw">
									<span class="title">地址：</span> <span class="province">${address.areaInfo!}</span>
									<span class="street">${address.address!}</span>
								</p>
							</div>
							<div class="new-addr-btn">
								<a href="#"><i class="am-icon-edit"></i>编辑</a> <span
									class="new-addr-bar">|</span> <a href="javascript:void(0);"
									onclick="delClick(this);"><i class="am-icon-trash"></i>删除</a>
							</div></li>
							 @}
						 @}

				</ul>
<input type="hidden" value="1" id="addressid" name="addressid"/>
<input type="hidden" value="1" id="paymentid" name="paymentid"/>
				<div class="clear"></div>
			</div>
			<!--物流 -->
			
			<div class="clear"></div>

			<!--支付方式-->
			<div class="logistics">
				<h3>选择支付方式</h3>
				<ul class="pay-list">
					@for(pay in payList!){
					<li class="pay card"><img
						src="${ctxPath}/static/mall/images/wangyin.jpg" />${pay.paymentName!}<span></span></li>
					@}
					<!-- <li class="pay card"><img src="${ctxPath}/static/mall/images/wangyin.jpg" />银联<span></span></li>
							<li class="pay qq"><img src="${ctxPath}/static/mall/images/weizhifu.jpg" />微信<span></span></li>
							<li class="pay taobao"><img src="${ctxPath}/static/mall/images/zhifubao.jpg" />支付宝<span></span></li> -->
				</ul>
			</div>
			<div class="clear"></div>

			<!--订单 -->
			<div class="concent">
				<div id="payTable">
					<h3>确认订单信息</h3>
					<div class="cart-table-th">
						<div class="wp">

							<div class="th th-item">
								<div class="td-inner">商品信息</div>
							</div>
							<div class="th th-price">
								<div class="td-inner">单价</div>
							</div>
							<div class="th th-amount">
								<div class="td-inner">数量</div>
							</div>
							<div class="th th-sum">
								<div class="td-inner">金额</div>
							</div>
							

						</div>
					</div>
					<div class="clear"></div>
					@for(cart in cartList!){
					<tr class="item-list">
						<div class="bundle  bundle-last">

							<div class="bundle-main">
								<ul class="item-content clearfix">
									<div class="pay-phone">
										<li class="td td-item">
											<div class="item-pic">
												<a href="${ctxPath!}/front/goods/goodsDetail/${cart.id!}" class="J_MakePoint"> <img
													src="${ctxPath!}/static/upload/project/${cart.img}"
													class="itempic J_ItemImg"></a>
											</div>
											<div class="item-info">
											<input type="hidden" name="cartIds" value="${cart.id!}"/>
												<div class="item-basic-info">
													<a href="#" class="item-title J_MakePoint"
														data-point="tbcart.8.11">${cart.goodsname!}</a>
												</div>
											</div>
										</li>
										
										<li class="td td-price">
											<div class="item-price price-promo-promo">
												<div class="price-content">
													<em class="J_Price price-now">${cart.price!}</em>
												</div>
											</div>
										</li>
									</div>
									<li class="td td-amount">
										<div class="amount-wrapper ">
											<div class="item-amount ">
												<span class="phone-title">购买数量</span>
												<div class="sl">
													<input class="min am-btn" id="jia" name="" type="button"
														value="-" /> <input class="text_box" name="count"
														type="text" value="${cart.count!}" style="width: 30px;" />
													<input class="add am-btn" id="jian" name="" type="button"
														value="+" />
												</div>
											</div>
										</div>
									</li>
									<li class="td td-sum">
										<div class="td-inner">
											<em tabindex="0" id="totalPrice" class="J_ItemSum number">${cart.price!}</em>
										</div>
									</li>
									

								</ul>
								<div class="clear"></div>

							</div>
					</tr>
					<div class="clear"></div>
					@}
				</div>
			</div>

			<div class="pay-total">
				<!--留言-->
				<div class="order-extra">
								<div class="order-user-info">
									<div id="holyshit257" class="memo">
										<label>买家留言：</label>
										<input type="text" name="usercontent" title="选填,对本次交易的说明（建议填写已经和卖家达成一致的说明）" placeholder="选填,建议填写和卖家达成一致的说明" class="memo-input J_MakePoint c2c-text-default memo-close">
										<div class="msg hidden J-msg">
											<p class="error">最多输入500个字符</p>
										</div>
									</div>
								</div>

							</div>
				<!--优惠券 -->
				<div class="buy-agio">
					<li class="td td-coupon"><span class="coupon-title">优惠券</span>
						<select data-am-selected>
							<option value="a">
								<div class="c-price">
									<strong>￥8</strong>
								</div>
								<div class="c-limit">【消费满95元可用】</div>
							</option>
							<option value="b" selected>
								<div class="c-price">
									<strong>￥3</strong>
								</div>
								<div class="c-limit">【无使用门槛】</div>
							</option>
					</select></li>

					<li class="td td-bonus"><span class="bonus-title">红包</span> <select
						data-am-selected>
							<option value="a">
								<div class="item-info">
									¥50.00<span>元</span>
								</div>
								<div class="item-remainderprice">
									<span>还剩</span>10.40<span>元</span>
								</div>
							</option>
							<option value="b" selected>
								<div class="item-info">
									¥50.00<span>元</span>
								</div>
								<div class="item-remainderprice">
									<span>还剩</span>50.00<span>元</span>
								</div>
							</option>
					</select></li>

				</div>
				<div class="clear"></div>
			</div>
			<!--含运费小计 -->
			<div class="buy-point-discharge ">
				<p class="price g_price ">
					合计（含运费） <span>¥</span><em class="pay-sum">${cart.price!}</em>
				</p>
			</div>

			<!--信息 -->
			<div class="order-go clearfix">
				<div class="pay-confirm clearfix">
					<div class="box">
						<div tabindex="0" id="holyshit267" class="realPay">
							<em class="t">实付款：</em> <span class="price g_price "> <span>¥</span>
								<em class="style-large-bold-red " id="J_ActualFee">${cart.price!}</em>
							</span>
						</div>

						<div id="holyshit268" class="pay-address">

							<p class="buy-footer-address">
								<span class="buy-line-title buy-line-title-type">寄送至：</span> <span
									class="buy--address-detail"> <span class="province">湖北</span>省
									<span class="city">武汉</span>市 <span class="dist">洪山</span>区 <span
									class="street">雄楚大道666号(中南财经政法大学)</span>
								</span> </span>
							</p>
							<p class="buy-footer-address">
								<span class="buy-line-title">收货人：</span> <span
									class="buy-address-detail"> <span class="buy-user">艾迪
								</span> <span class="buy-phone">15871145629</span>
								</span>
							</p>
						</div>
					</div>

					<div id="holyshit269" class="submitOrder">
						<div class="go-btn-wrap">
						<input id="J_Go" 
								class="btn-go" type="submit" tabindex="0" title="点击此按钮，提交订单" value="提交订单"/>
							<!-- <a id="J_Go" 
								class="btn-go" href="javascript:submitOrder()" tabindex="0" title="点击此按钮，提交订单">提交订单</a> -->
						</div>
					</div>
					<div class="clear"></div>
				</div>
			</div>
		</div>
</form>
		<div class="clear"></div>
					</div>
				</div>
				<div class="footer">
					<div class="footer-hd">
						<p>
							<a href="#">zsCat科技</a>
							<b>|</b>
							<a href="#">商城首页</a>
							<b>|</b>
							<a href="#">支付宝</a>
							<b>|</b>
							<a href="#">物流</a>
						</p>
					</div>
					<div class="footer-bd">
						<p>
							<a href="#">关于zsCat</a>
							<a href="#">合作伙伴</a>
							<a href="#">联系我们</a>
							<a href="#">网站地图</a>
							<em>© 2015-2025 zsCat.com 版权所有</em>
						</p>
					</div>
				</div>
			</div>
			<div class="theme-popover-mask"></div>
			<div class="theme-popover">

				<!--标题 -->
				<div class="am-cf am-padding">
					<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">新增地址</strong> / <small>Add address</small></div>
				</div>
				<hr/>

				<div class="am-u-md-12">
					<form class="am-form am-form-horizontal" method="post" id="address_form" action="${ctxPath}/person/saveAddress1">

						<div class="am-form-group">
							<label for="user-name" class="am-form-label">收货人</label>
							<div class="am-form-content">
								<input type="text" id="user-name" placeholder="收货人">
							</div>
						</div>

						<div class="am-form-group">
							<label for="user-phone" class="am-form-label">手机号码</label>
							<div class="am-form-content">
								<input id="user-phone" placeholder="手机号必填" type="email">
							</div>
						</div>

						<div class="am-form-group">
							<label for="user-phone" class="am-form-label">所在地</label>
							<div class="am-form-content address">
								<select data-am-selected>
									<option value="a">浙江省</option>
									<option value="b">湖北省</option>
								</select>
								<select data-am-selected>
									<option value="a">温州市</option>
									<option value="b">武汉市</option>
								</select>
								<select data-am-selected>
									<option value="a">瑞安区</option>
									<option value="b">洪山区</option>
								</select>
							</div>
						</div>

						<div class="am-form-group">
							<label for="user-intro" class="am-form-label">详细地址</label>
							<div class="am-form-content">
								<textarea class="" rows="3" id="user-intro" placeholder="输入详细地址"></textarea>
								<small>100字以内写出你的详细地址...</small>
							</div>
						</div>

						<div class="am-form-group theme-poptit">
							<div class="am-u-sm-9 am-u-sm-push-3">
								<div class="am-btn am-btn-danger" onclick="saveAddress()" type="submit">保存</div>
								<div class="am-btn am-btn-danger close">取消</div>
							</div>
						</div>
					</form>
				</div>

			</div>

			<div class="clear"></div>
			<script type="text/javascript">

function saveAddress(){
	$.ajax({
		type: "post",
 		url: '${ctxPath}/person/saveAddress1',
		data: {addressId:id},
		dataType: "json",
		success:function(data) {
			if(data.success){
				window.location.href = "${ctxPath!}/person/address";
		      //  obj.find("a").remove();
		       //	$("input[name='address_options']").attr("isDefault",0);
		      //  $("#"+addressId).attr("isDefault",1);
			}else{
				layer.msg("默认地址设置失败!",{icon:2});
			}
		}
	});
}
function setDefault(id){
	//var addressId = "address_"+id;
	$.ajax({
		type: "post",
 		url: '${ctxPath}/person/setAddressDef',
		data: {addressId:id},
		dataType: "json",
		success:function(data) {
			if(data.success){
				window.location.href = "${ctxPath!}/person/address";
		      //  obj.find("a").remove();
		       //	$("input[name='address_options']").attr("isDefault",0);
		      //  $("#"+addressId).attr("isDefault",1);
			}else{
				layer.msg("默认地址设置失败!",{icon:2});
			}
		}
	});
}
</script>
	</body>

</html>